<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .nav-code-pos {
            height: 40px;
            border-bottom: 1px solid #ccc;
        }

        .nav-code-pos ul {
            width: 1200px;
            list-style: none;
            /* display: flex;
            justify-content: space-between;
            align-items: space-between; */
            margin: 0 auto;


        }

        .nav-code-pos ul li {
            float: left;
            width: 20%;
            border-right: 1px solid #ccc;
            height: 40px;
            line-height: 40px;
            text-align: center;
            box-sizing: border-box;
        }

        .nav-code-pos ul li:last-child {
            border-right: none;
        }

        .nav-code-pos ul li a {
            /* a为行内元素，不能设置宽高，需设置为块级才能设置宽高 */
            display: block;
            height: 40px;
            text-decoration: none;
            color: #000;

        }

        .phone-code {
            position: relative;
        }

        .nav-code-pos .phone-code .code-img {
            /* display: none; 不占位，且隐藏*/
            display: none;
            position: absolute;
            border: 1px solid #ccc;
            top: 40px;
            left: 0;
            transform: translateX(50%);
            /* transform: translate(-50%, -50%); */
        }


        .nav-code-pos a:hover .code-img {
            display: block;
        }
    </style>
</head>

<body>
    <div class="nav-code-pos">
        <ul>
            <li><a href="#">我要投资</a></li>
            <li><a href="#">平台介绍</a></li>
            <li><a href="#">新手专区</a></li>
            <li><a href="#" class="phone-code">手机微金所<img src="./images/code.jpg" class="code-img" alt=""></a></li>
            <li><a href="#">个人中心</a></li>
        </ul>

    </div>
</body>

</html>